﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml"; }
@section scripts
{
    <script src="~/Content/js/core/viewModel.search.js" type="text/javascript"></script>
    @RenderSection("scripts", false)
    <script type="text/javascript">
        $(document).ready(function () {

            $(window).resize(function () {
                resizeLayout();
            });
            resizeLayout();
        });

        function resizeLayout() {
            var mainHeight = $("body").height() - 7;
            $("#grid").height(mainHeight - $("#toolbar").outerHeight() - $("#condition").outerHeight());
           $("#dg").datagrid("resize", {
          });
            //$("#dg").css({width:500});
        }
        
        
        var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
        var viewModel = com.viewModel.search;
        var m = new viewModel(data);
        ko.bindingViewModel(m);
        
    </script>
}
<div id="toolbar" style="border: 1px solid #ddd;">
    <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-search'"
        data-bind="click:search">Search</a> <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'"
            data-bind="click:add">Add </a><a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-edit'"
                data-bind="click:edit">Edit</a> <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-delete'"
                    data-bind="click:remove">Delete</a><a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-close'"
            data-bind="click:close">Close</a>
</div>
<div id="condition">
    @RenderSection("search", false)
</div>
<div id="grid">
    @RenderBody()
</div>
